/*
 * DropButtonAdapterFactory.java
 * Copyright (C) 2007 Ezequiel Turovetzky
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 3
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, see <http://www.gnu.org/licenses/>.
 */
package ar.com.botonera.gui.common;

import ar.com.botonera.gui.common.listeners.DropButtonAdapter;
import ar.com.botonera.gui.common.listeners.UnixDropButtonAdapter;
import ar.com.botonera.gui.common.listeners.WindowsDropButtonAdapter;

/**
 * Factory de adaptadores de dropeo.
 * <br>
 * Debido a que la implementaci&oacute;n del drop es distinta
 * en sistemas <code>Unix</code> y <code>Windows</code>, esta clase
 * es la encargada de devolver la implementaci&oacute;n espec&iacute;fica
 * del drop.
 * @author <a href="mailto:tezequiel@gmail.com">Ezequiel Turovetzky</a>
 * @version 1.0
 */
public class DropButtonAdapterFactory {

    //~ Methods ----------------------------------------------------------------

    /**
     * Devuelve el <code>DropButtonAdapter</code> que implementa
     * el dropeo especialmente para la plataforma en la que se est&aacute;
     * corriendo la aplicaci&oacute;n.
     * @return Un <code>DropButtonAdapter</code>
     */
    public static DropButtonAdapter getAdapter() {
        DropButtonAdapter adapter = null;
        if(System.getProperty("os.name").contains("Windows")) {
            adapter = new WindowsDropButtonAdapter();
        } else {
            adapter = new UnixDropButtonAdapter();
        }

        return adapter;
    }
}
